import React from 'react';
import PropTypes from 'prop-types';

export default class Status extends React.Component {
  static propTypes = {
    title: PropTypes.string.isRequired,
    count: PropTypes.number.isRequired,
    weight: PropTypes.number.isRequired,
  }

  static defaultProps = {
    title: '',
    count: 0,
    weight: 0,
  }

  render() {
    const { title, count, weight } = this.props;
    return (
      <div>
        <h2 className="apple__status__title">{title}</h2>
        <div className="apple__status__info">
          <strong>{count}</strong>个苹果，<strong>{weight}</strong>克
        </div>
      </div>
    );
  }
}
